wifi.setmode(wifi.STATION) 
wifi.sta.config{ssid="admin123", pwd="12345678"} 
wifi.sta.connect()  

mytmr = tmr.create()
mytmr:alarm(500,tmr.ALARM_AUTO,function ()
    wifi_ip =wifi.getip()
    if wifi_ip ~= nil then
        print(wifi_ip)
        mytmr:stop()
    end
    print("----getip------")
end)

